package com.way.demo.test;

import java.util.Scanner;

/**
 * @author lipingwei
 * @create 2023-03-05 16:05
 */
public class CalTest2 {

    public static void main(String[] args) {

           while (true){
               Scanner scanner = new Scanner(System.in);

               System.out.println("请输入第一个数字");
               int one = scanner.nextInt();
               System.out.println("请输入第二个数字");
               int two = scanner.nextInt();

               System.out.println("请输入符号：+ - * /");
               String symbol = scanner.next();

                switch (symbol){
                    case  "+" :
                            System.out.println("两个数的和为："+ (one+two) );
                        break;

                    case  "-" :
                        System.out.println("两个数的差为："+ (one-two) );
                        break;

                    case  "*" :
                        System.out.println("两个数的积为："+ (one*two) );
                        break;

                    case  "/" :
                        System.out.println("两个数商为："+ (one*two) );
                        break;

                    default:
                        System.out.println("符号输入错误");
                }

           }

    }

}
